import request from '@/utils/request'

// 创建首页信息
export function createHomepage(data) {
  return request({
    url: '/system/homepage/create',
    method: 'post',
    data: data
  })
}

// 更新首页信息
export function updateHomepage(data) {
  return request({
    url: '/system/homepage/update',
    method: 'put',
    data: data
  })
}

// 删除首页信息
export function deleteHomepage(id) {
  return request({
    url: '/system/homepage/delete?id=' + id,
    method: 'delete'
  })
}

// 获得首页信息
export function getHomepage(id) {
  return request({
    url: '/system/homepage/get?id=' + id,
    method: 'get'
  })
}

// 获得首页信息分页
export function getHomepagePage(params) {
  return request({
    url: '/system/homepage/page',
    method: 'get',
    params
  })
}
// 导出首页信息 Excel
export function exportHomepageExcel(params) {
  return request({
    url: '/system/homepage/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获得首页数据
export function getHomepageData() {
  return request({
    url: '/system/homepage/getHomePage',
    method: 'get'
  })
}